/**
 * 
 */
package us.gaaoc.framework.dao;

import org.hibernate.Query;

import us.gaaoc.framework.model.Court;
import us.gaaoc.framework.model.LocalParticipantRelationship;

/**
 * 
 * @author hea
 * May 18, 2007
 */
public class LocalParticipantRelationshipDAOHibernate extends GenericHibernateDAO<LocalParticipantRelationship, Integer, LocalParticipantRelationshipDAO>
implements  LocalParticipantRelationshipDAO{

	public LocalParticipantRelationship findLocalParticipantRelationship(Court court, int participantRelationshipCode) {
		Query q = this.getSession().createQuery("from LocalParticipantRelationship r where r.court = ? and r.participantRelationship.code = ?");
		q.setEntity(0, court);
		q.setInteger(1, participantRelationshipCode);
		
		return (LocalParticipantRelationship)q.uniqueResult();
	}
}
